#ifndef WORKINGTHREAD_H
#define WORKINGTHREAD_H

#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include <QString>
#include "comminucationhandler.hpp"
#include "XmlProccessor.h"

class WorkingThread : public QThread
{
    Q_OBJECT



public:
    explicit WorkingThread(QString worker_name,ComminucationHandler *communication,QObject *parent = 0);

    ~WorkingThread()
    {
        delete mutex;
        delete result_recieved;
    }
Q_SIGNALS:
    void Log(QString str);

private Q_SLOTS:
    void ResultRecieved(QString target,QString message);

private:
    //Variables
    ComminucationHandler *comminucation_handler;
    QString RecievedData;

protected:

    //Variables
    QString workerName;
    QString commitCommand(QString target, QString command);
    QMutex *mutex;
    QWaitCondition *result_recieved;

    //Functions
    QString getWorkerName() const;
    
};

#endif // WORKINGTHREAD_H
